using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;


namespace ui.text
{
	public class TextList
	{
		private IEnumerable e;
		
		public TextList (IEnumerable e)
		{
			this.e = e;
		}
		
		public string Join(string separator)
		{
			var b = new StringBuilder();
			Join(separator, b);
			return b.ToString();
		}
		
		public void Join(string separator, StringBuilder b)
		{
			bool first = true;
			foreach (var item in e) {
				if (!first) b.Append(separator);
				b.Append(item.ToString());
				first = false;
			}
		}
	}
}

